/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Background;

import Core.Vector2;
import Environment.Gravity;
import Thing.Thing;
import java.io.IOException;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.game.Sprite;
import javax.microedition.lcdui.game.TiledLayer;

/**
 *
 * @author THINH
 */
public class Background {
    protected TiledLayer tiledLayer = null;
    Vector2 againstVec;
    
    public Background(){
        againstVec = Vector2.Zero();        

    }
    //main func
    public void CollisionWith(Thing thing){
        
    }
    // position func
    
    public Vector2 getPos(){
        return new Vector2(tiledLayer.getX(),tiledLayer.getY());
    }
    public void setPos(Vector2 newPoint){
        tiledLayer.setPosition((int)newPoint.x, (int)newPoint.y);
    }
    public void setPos(float x, float y){
        tiledLayer.setPosition((int)x, (int)y);
    }
    
    public int getWidth(){
        return tiledLayer.getWidth();
    }
    
    public int getHeight(){
        return tiledLayer.getHeight();
    }
    // tiledLayer func
    public TiledLayer getTiledLayer(){
        return tiledLayer;
    }
    
    public void setTiledLayer(TiledLayer newSprite){
        tiledLayer = newSprite;
        setPos(0, 0);
    }
    
}
